package kaa.archivator;

import java.io.IOException;
import java.nio.file.FileVisitResult;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.LinkedList;

class MyFileVisitor extends SimpleFileVisitor<Path> {

    private LinkedList<Path> flist = new LinkedList<Path>();

    @Override
    public FileVisitResult preVisitDirectory(Path folder, BasicFileAttributes attr) throws IOException {
        flist.push(folder);
        return FileVisitResult.CONTINUE;
    }

    @Override
    public FileVisitResult visitFile(Path file,
                                     BasicFileAttributes attr) throws IOException {
        flist.push(file);
        return FileVisitResult.CONTINUE;
    }


    public void setFlist(LinkedList<Path> flist) {
        this.flist = flist;
    }

    public LinkedList<Path> getFlist() {
        return flist;
    }
}